<!DOCTYPE HTML>
<html lang="zh-hans" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>3.A-Y-A-D 数据集分析 | Apache Drill</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.6">
        <meta name="author" content="smartloli">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-tbfed-pagefooter/footer.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html" />
    
    
    <link rel="prev" href="../3.教程/2.Drill in 10 Minutes 快速指导.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.3"
        data-chapter-title="3.A-Y-A-D 数据集分析"
        data-filepath="3.教程/3.A-Y-A-D 数据集分析.md"
        data-basepath=".."
        data-revision="Fri Aug 26 2016 12:40:11 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
                
                <li>
                    <a href="http://drill.smartloli.org" target="blank" class="custom-link">Apache Drill</a>
                </li>
            
            

            
            <li class="divider"></li>
            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        前言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" >
            
            <span><b>1.</b> 1.开始</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="1.开始/1.Introduction 介绍.html">
            
                
                    <a href="../1.开始/1.Introduction 介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        1.Introduction 介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="1.开始/2.Why Drill 为什么使用 Drill.html">
            
                
                    <a href="../1.开始/2.Why Drill 为什么使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        2.Why Drill 为什么使用 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" >
            
            <span><b>2.</b> 2.架构</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="2.架构/1.Architecture Introduction 架构介绍.html">
            
                
                    <a href="../2.架构/1.Architecture Introduction 架构介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        1.Architecture Introduction 架构介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2.架构/2.Drill Query Execution Drill 查询执行.html">
            
                
                    <a href="../2.架构/2.Drill Query Execution Drill 查询执行.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        2.Drill Query Execution Drill 查询执行
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="2.架构/3.Core Modules 核心模块.html">
            
                
                    <a href="../2.架构/3.Core Modules 核心模块.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        3.Core Modules 核心模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="2.架构/4.Performance 性能.html">
            
                
                    <a href="../2.架构/4.Performance 性能.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        4.Performance 性能
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" >
            
            <span><b>3.</b> 3.教程</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="3.教程/1.Tutorials Introduction 教程介绍.html">
            
                
                    <a href="../3.教程/1.Tutorials Introduction 教程介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        1.Tutorials Introduction 教程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="3.教程/2.Drill in 10 Minutes 快速指导.html">
            
                
                    <a href="../3.教程/2.Drill in 10 Minutes 快速指导.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        2.Drill in 10 Minutes 快速指导
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.3" data-path="3.教程/3.A-Y-A-D 数据集分析.html">
            
                
                    <a href="../3.教程/3.A-Y-A-D 数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        3.A-Y-A-D 数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" >
            
            <span><b>3.4.</b> 4.在 MapR 的 Sandbox 中学习 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.4.1" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.1.</b>
                        
                        1.关于 MapR 的 Sandbox
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.2" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.2.</b>
                        
                        2.在 Sandbox 中安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.3" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.3.</b>
                        
                        3.在 Sandbox 中使用 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.4" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.4.</b>
                        
                        4.课程1:学习数据集
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.5" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.5.</b>
                        
                        5.课程2:使用 ANSI SQL 查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.6" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.6.</b>
                        
                        6.课程3:查询复杂的数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.7" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
            
                
                    <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.7.</b>
                        
                        7.总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="3.教程/5.高度动态的数据集分析.html">
            
                
                    <a href="../3.教程/5.高度动态的数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        5.高度动态的数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="3.教程/6.社会媒体分析.html">
            
                
                    <a href="../3.教程/6.社会媒体分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        6.社会媒体分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="3.教程/7.使用窗口函数分析数据.html">
            
                
                    <a href="../3.教程/7.使用窗口函数分析数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        7.使用窗口函数分析数据
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 4.安装 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="4.安装 Drill/1.Drill 安装介绍.html">
            
                
                    <a href="../4.安装 Drill/1.Drill 安装介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        1.Drill 安装介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="4.安装 Drill/2.迁移 Parquet 数据.html">
            
                
                    <a href="../4.安装 Drill/2.迁移 Parquet 数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        2.迁移 Parquet 数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" >
            
            <span><b>4.3.</b> 3.安装 Drill 到嵌入模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.3.1" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.1.</b>
                        
                        1.嵌入模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.2" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.2.</b>
                        
                        2.在 Linux 和 Mac OS X 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.3" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.3.</b>
                        
                        3.在 Linux 和 Mac OS X 上启动 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.4" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.4.</b>
                        
                        4.在 Windows 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.5" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.5.</b>
                        
                        5.在 Windows 上启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4" >
            
            <span><b>4.4.</b> 4.安装 Drill 到分布式模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        1.分布式模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        2.在集群上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
            
                
                    <a href="../4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        3.在分布式模式下启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="4.安装 Drill/5.启动 Web 控制台.html">
            
                
                    <a href="../4.安装 Drill/5.启动 Web 控制台.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        5.启动 Web 控制台
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" >
            
            <span><b>5.</b> 5.配置 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="5.配置 Drill/1.配置介绍.html">
            
                
                    <a href="../5.配置 Drill/1.配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        1.配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="5.配置 Drill/2.配置内存.html">
            
                
                    <a href="../5.配置 Drill/2.配置内存.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        2.配置内存
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" >
            
            <span><b>5.3.</b> 3.配置一个多租户集群</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.3.1" data-path="5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.1.</b>
                        
                        1.配置一个多租户介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.2" data-path="5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.2.</b>
                        
                        2.配置多租户资源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.3" data-path="5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
            
                
                    <a href="../5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.3.</b>
                        
                        3.配置 Drillbit 共享资源
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="5.配置 Drill/4.配置模拟身份.html">
            
                
                    <a href="../5.配置 Drill/4.配置模拟身份.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        4.配置模拟身份
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="5.配置 Drill/5.配置用户身份验证.html">
            
                
                    <a href="../5.配置 Drill/5.配置用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        5.配置用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="5.配置 Drill/6.配置 Hive 用户身份验证.html">
            
                
                    <a href="../5.配置 Drill/6.配置 Hive 用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        6.配置 Hive 用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
            
                
                    <a href="../5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        7.配置 Web 控制台和 REST API 安全
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" >
            
            <span><b>5.8.</b> 8.可选配置</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.8.1" data-path="5.配置 Drill/8.可选配置/1.可选配置介绍.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/1.可选配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.1.</b>
                        
                        1.可选配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.2" data-path="5.配置 Drill/8.可选配置/2.启动可选项.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/2.启动可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.2.</b>
                        
                        2.启动可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.3" data-path="5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.3.</b>
                        
                        3.计划和执行可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.4" data-path="5.配置 Drill/8.可选配置/4.持久化配置存储.html">
            
                
                    <a href="../5.配置 Drill/8.可选配置/4.持久化配置存储.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.4.</b>
                        
                        4.持久化配置存储
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="5.配置 Drill/9.Drill 端口使用.html">
            
                
                    <a href="../5.配置 Drill/9.Drill 端口使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        9.Drill 端口使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="5.配置 Drill/10.配置 Drill 终端.html">
            
                
                    <a href="../5.配置 Drill/10.配置 Drill 终端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        10.配置 Drill 终端
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" >
            
            <span><b>6.</b> 6.连接数据源</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="6.连接数据源/1.介绍.html">
            
                
                    <a href="../6.连接数据源/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="6.连接数据源/2.注册存储插件.html">
            
                
                    <a href="../6.连接数据源/2.注册存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        2.注册存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" >
            
            <span><b>6.3.</b> 3.配置存储插件</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.3.1" data-path="6.连接数据源/3.配置存储插件/1.插件基础设置.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/1.插件基础设置.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.1.</b>
                        
                        1.插件基础设置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.2" data-path="6.连接数据源/3.配置存储插件/2.工作区间.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/2.工作区间.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.2.</b>
                        
                        2.工作区间
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.3" data-path="6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
            
                
                    <a href="../6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.3.</b>
                        
                        3.Drill 默认输出格式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="6.连接数据源/4.文件系统存储插件.html">
            
                
                    <a href="../6.连接数据源/4.文件系统存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        4.文件系统存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="6.连接数据源/5.HBase 存储插件.html">
            
                
                    <a href="../6.连接数据源/5.HBase 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        5.HBase 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="6.连接数据源/6.Hive 存储插件.html">
            
                
                    <a href="../6.连接数据源/6.Hive 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        6.Hive 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="6.连接数据源/7.RDBMS 存储插件.html">
            
                
                    <a href="../6.连接数据源/7.RDBMS 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        7.RDBMS 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="6.连接数据源/8.MongoDB 存储插件.html">
            
                
                    <a href="../6.连接数据源/8.MongoDB 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        8.MongoDB 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="6.连接数据源/9.S3 存储插件.html">
            
                
                    <a href="../6.连接数据源/9.S3 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        9.S3 存储插件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" >
            
            <span><b>7.</b> 7.ODBC 和 JDBC 接口</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="7.ODBC 和 JDBC 接口/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" >
            
            <span><b>7.4.</b> 4.安装 ODBC 驱动</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.4.1" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.1.</b>
                        
                        1.在 Linux 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.2" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.2.</b>
                        
                        2.在 Mac OS X 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.3" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.3.</b>
                        
                        3.在 Windows 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.4" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.4.</b>
                        
                        4.在 Windows 上安装 TDC 文件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.5" >
            
            <span><b>7.5.</b> 5.配置 ODBC</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.5.1" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.1.</b>
                        
                        1.ODBC 配置参考
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.2" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.2.</b>
                        
                        2.在 Linux 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.3" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.3.</b>
                        
                        3.在 Max OS X 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.4" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.4.</b>
                        
                        4.在 Windows 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.5" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.5.</b>
                        
                        5.测试 ODBC 连接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.6" >
            
            <span><b>7.6.</b> 6.使用 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.6.1" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.2" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.2.</b>
                        
                        2.连接 Drill 到数据源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.3" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.3.</b>
                        
                        3.浏览数据和定义视图
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.7" >
            
            <span><b>7.7.</b> 7.用 BI 工具连接 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.7.1" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.2" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.3" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.4" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.4.</b>
                        
                        4.使用 Tibco Spotfire 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.5" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.5.</b>
                        
                        5.使用 Qlik Sense
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.6" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.6.</b>
                        
                        6.使用 Tableau 9 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.7" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.7.</b>
                        
                        7.使用 Tableau 9 服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.8" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
            
                
                    <a href="../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.8.</b>
                        
                        8.配置 JReport
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Apache Drill</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="yelp-&#x6570;&#x636E;&#x96C6;&#x5206;&#x6790;">Yelp &#x6570;&#x636E;&#x96C6;&#x5206;&#x6790;</h1>
<p>Apache Drill &#x662F;&#x5F00;&#x6E90;&#x9879;&#x76EE;&#x53D1;&#x5C55;&#x901F;&#x5EA6;&#x6700;&#x5FEB;&#x7684;&#x9879;&#x76EE;&#x4E4B;&#x4E00;&#xFF0C;&#x793E;&#x533A;&#x6BCF;&#x6708;&#x4F1A;&#x53D1;&#x5E03;&#x4E00;&#x4E2A;&#x7248;&#x672C;&#x3002;&#x5173;&#x952E;&#x7684;&#x4E0D;&#x540C;&#x70B9;&#x662F; Drill &#x5177;&#x6709;&#x5176;&#x654F;&#x6377;&#x6027;&#x548C;&#x7075;&#x6D3B;&#x6027;&#x3002;&#x5728;&#x4F1A;&#x8BAE;&#x4E0A;&#x63D0;&#x51FA; SQL On Hadoop&#xFF0C;&#x7528;&#x4E8E;&#x5B8C;&#x6210;&#x4F4E;&#x5EF6;&#x65F6;&#x7684;&#x6027;&#x80FD;&#x6307;&#x6807;&#xFF0C;Drill &#x5141;&#x8BB8;&#x7528;&#x6237;&#x5728;&#x6CA1;&#x6709; ETL &#x6216;&#x4E8B;&#x5148;&#x6CA1;&#x6709;&#x5B9A;&#x4E49; Schema &#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5B8C;&#x6210;&#x6570;&#x636E;&#x7684;&#x5206;&#x6790;&#x3002;&#x6570;&#x636E;&#x53EF;&#x4EE5;&#x4E3A;&#x4EFB;&#x610F;&#x683C;&#x5F0F;&#xFF0C;&#x4F8B;&#x5982; text&#xFF0C;JSON &#x6216;&#x662F; Parquet&#x3002;&#x6570;&#x636E;&#x53EF;&#x4EE5;&#x662F;&#x7B80;&#x5355;&#x7C7B;&#x578B;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;string&#xFF0C;integer&#xFF0C;date &#x6216;&#x662F;&#x66F4;&#x52A0;&#x590D;&#x6742;&#x7ED3;&#x6784;&#x6570;&#x636E;&#xFF0C;&#x4F8B;&#x5982;&#x5D4C;&#x5957;&#x7684; Map &#x96C6;&#x5408;&#x548C;&#x6570;&#x7EC4;&#x3002;&#x6570;&#x636E;&#x53EF;&#x4EE5;&#x5728;&#x4EFB;&#x4F55;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#x5B58;&#x5728;&#xFF0C;&#x672C;&#x5730;&#x6216;&#x662F;&#x5206;&#x5E03;&#x5F0F;&#x4E2D;&#xFF0C;&#x4F8B;&#x5982; HDFS &#x6216;&#x662F; S3&#x3002;Drill&#xFF0C;&#x6709;&#x4E00;&#x4E2A;&#x201C;&#x65E0; Schema&#x201D;&#x7684;&#x9014;&#x5F84;&#xFF0C;&#x5B83;&#x80FD;&#x591F;&#x8BA9;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x51E0;&#x5206;&#x949F;&#xFF0C;&#x5C31;&#x80FD;&#x4ECE;&#x4F60;&#x7684;&#x6570;&#x636E;&#x4E2D;&#x83B7;&#x5F97;&#x60F3;&#x8981;&#x7684;&#x503C;&#x3002;</p>
<p>&#x8BA9;&#x6211;&#x4EEC;&#x5FEB;&#x901F;&#x7684;&#x901A;&#x8FC7;&#x9700;&#x8981;&#x5B89;&#x88C5; Drill &#x548C;&#x9700;&#x8981;&#x8FD0;&#x884C; Yelp &#x6570;&#x636E;&#x96C6;&#x7684;&#x6B65;&#x9AA4;&#x3002;&#x4ECE; Yelp &#x4E2D;&#x4E0B;&#x8F7D;&#x516C;&#x5F00;&#x7684;&#x793A;&#x4F8B;&#x6570;&#x636E;&#x96C6;&#x5E76;&#x5C06;&#x5176;&#x683C;&#x5F0F;&#x5316;&#x4E3A; JSON&#x3002;</p>
<h1 id="&#x5B89;&#x88C5;&#x548C;&#x542F;&#x52A8;-drill">&#x5B89;&#x88C5;&#x548C;&#x542F;&#x52A8; Drill</h1>
<h2 id="&#x4E0B;&#x8F7D;-apache-drill-&#x5230;&#x4F60;&#x672C;&#x5730;&#x673A;&#x5668;">&#x4E0B;&#x8F7D; Apache Drill &#x5230;&#x4F60;&#x672C;&#x5730;&#x673A;&#x5668;</h2>
<p>&#x5728;&#x672C;&#x5730;&#x8FDB;&#x884C; Drill &#x5B9E;&#x9A8C;&#xFF0C;&#x6309;&#x7167; <a href="2.Drill%20in%2010%20Minutes%20&#x5FEB;&#x901F;&#x6307;&#x5BFC;.md">&#x5FEB;&#x901F;&#x6307;&#x5BFC;</a>&#x7684;&#x6B65;&#x9AA4;&#x8FDB;&#x884C;&#x5B9E;&#x9A8C;&#x3002;</p>
<p>&#x53E6;&#x5916;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x60F3;&#x6269;&#x5C55;&#x4F60;&#x7684;&#x73AF;&#x5883;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5C06; Drill &#x90E8;&#x7F72;&#x5728;&#x5206;&#x5E03;&#x5F0F;&#x73AF;&#x5883;&#x4E0B;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#xFF0C;&#x8BA9;&#x6211;&#x4EEC;&#x5C1D;&#x8BD5;&#x7528;&#x4E00;&#x4E9B; SQL &#x793A;&#x4F8B;&#xFF0C;&#x53BB;&#x7406;&#x89E3; Drill &#x5982;&#x4F55;&#x7B80;&#x6613;&#x7684;&#x5206;&#x6790;&#x6570;&#x636E;&#x3002;</p>
<pre><code>&#x6CE8;&#x91CA;&#xFF1A;

&#x4F60;&#x9700;&#x8981;&#x66FF;&#x6362;&#x4F60;&#x672C;&#x5730;&#x8DEF;&#x5F84;&#x7684; Yelp &#x6570;&#x636E;&#x96C6;&#x5728;&#x89D2;&#x62EC;&#x53F7;&#x4E2D;&#xFF0C;&#x9488;&#x5BF9;&#x4F60;&#x8FD0;&#x884C;&#x7684;&#x6BCF;&#x4E2A;&#x67E5;&#x8BE2;&#x3002;
</code></pre><h1 id="&#x5728;-drill-&#x4E2D;&#x67E5;&#x8BE2;&#x6570;&#x636E;">&#x5728; Drill &#x4E2D;&#x67E5;&#x8BE2;&#x6570;&#x636E;</h1>
<h2 id="1&#x53EF;&#x89C6;&#x5316;-yelp-&#x7684;&#x4E1A;&#x52A1;&#x6570;&#x636E;">1.&#x53EF;&#x89C6;&#x5316; Yelp &#x7684;&#x4E1A;&#x52A1;&#x6570;&#x636E;</h2>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; !<span class="hljs-built_in">set</span> maxwidth <span class="hljs-number">10000</span>

<span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select * from
    dfs.`&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`
    <span class="hljs-built_in">limit</span> <span class="hljs-number">1</span>;

+------------------------+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+--------------------------------+---------+--------------+-------------------+-------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------------+
| business_id            | full_address                                       | hours                                                                                                                                                                                                                                                      | open | categories                     | city    | review_count | name              | longitude   | state | stars | latitude  | attributes                                                                                                                                                   | <span class="hljs-built_in">type</span>     | neighborhoods |
+------------------------+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+--------------------------------+---------+--------------+-------------------+-------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------------+
| vcNAWiLM4dR7D2nwwJ7nCA | <span class="hljs-number">4840</span> E Indian School Rd Ste <span class="hljs-number">101</span>, Phoenix, AZ <span class="hljs-number">85018</span> | fill <span class="hljs-keyword">in</span>{<span class="hljs-string">&quot;Tuesday&quot;</span>:{<span class="hljs-string">&quot;close&quot;</span>:<span class="hljs-string">&quot;17:00&quot;</span>,<span class="hljs-string">&quot;open&quot;</span>:<span class="hljs-string">&quot;08:00&quot;</span>},<span class="hljs-string">&quot;Friday&quot;</span>:{<span class="hljs-string">&quot;close&quot;</span>:<span class="hljs-string">&quot;17:00&quot;</span>,<span class="hljs-string">&quot;open&quot;</span>:<span class="hljs-string">&quot;08:00&quot;</span>},<span class="hljs-string">&quot;Monday&quot;</span>:{<span class="hljs-string">&quot;close&quot;</span>:<span class="hljs-string">&quot;17:00&quot;</span>,<span class="hljs-string">&quot;open&quot;</span>:<span class="hljs-string">&quot;08:00&quot;</span>},<span class="hljs-string">&quot;Wednesday&quot;</span>:{<span class="hljs-string">&quot;close&quot;</span>:<span class="hljs-string">&quot;17:00&quot;</span>,<span class="hljs-string">&quot;open&quot;</span>:<span class="hljs-string">&quot;08:00&quot;</span>},<span class="hljs-string">&quot;Thursday&quot;</span>:{<span class="hljs-string">&quot;close&quot;</span>:<span class="hljs-string">&quot;17:00&quot;</span>,<span class="hljs-string">&quot;open&quot;</span>:<span class="hljs-string">&quot;08:00&quot;</span>},<span class="hljs-string">&quot;Sunday&quot;</span>:{},<span class="hljs-string">&quot;Saturday&quot;</span>:{}} | <span class="hljs-literal">true</span> | [<span class="hljs-string">&quot;Doctors&quot;</span>,<span class="hljs-string">&quot;Health &amp; Medical&quot;</span>] | Phoenix | <span class="hljs-number">7</span>            | Eric Goldberg, MD | -<span class="hljs-number">111.983758</span> | AZ    | <span class="hljs-number">3.5</span>   | <span class="hljs-number">33.499313</span> | {<span class="hljs-string">&quot;By Appointment Only&quot;</span>:<span class="hljs-literal">true</span>,<span class="hljs-string">&quot;Good For&quot;</span>:{},<span class="hljs-string">&quot;Ambience&quot;</span>:{},<span class="hljs-string">&quot;Parking&quot;</span>:{},<span class="hljs-string">&quot;Music&quot;</span>:{},<span class="hljs-string">&quot;Hair Types Specialized In&quot;</span>:{},<span class="hljs-string">&quot;Payment Types&quot;</span>:{},<span class="hljs-string">&quot;Dietary Restrictions&quot;</span>:{}} | business | []            |
+------------------------+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+--------------------------------+---------+--------------+-------------------+-------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------------+
</code></pre>
<pre><code>&#x6CE8;&#x91CA;&#xFF1A;

&#x672C;&#x6587;&#x4EF6;&#x4EE5;&#x793A;&#x4F8B;&#x4E3A;&#x76EE;&#x7684;&#x5BF9; Drill &#x7ED3;&#x679C;&#x8FDB;&#x884C;&#x8F93;&#x51FA;&#x3002;&#x8FD9;&#x79CD;&#x8F93;&#x51FA;&#x662F;&#x4E0D;&#x5BF9;&#x79F0;&#x7684;&#xFF08;&#x5373;&#xFF1A;&#x4E0D;&#x80FD;&#x5B8C;&#x5168;&#x5339;&#x914D;&#xFF09;&#x3002;
</code></pre><p>&#x4F60;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x67E5;&#x8BE2;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x4F8B;&#x5982; JSON&#xFF0C;Parquet &#x548C; text &#x6587;&#x4EF6;&#x3002;&#x5B83;&#x4EEC;&#x4E0D;&#x9700;&#x8981;&#x521B;&#x5EFA;&#x548C;&#x5B9A;&#x4E49;&#x5143;&#x6570;&#x636E;&#x5728; Hive &#x7684;&#x5143;&#x6570;&#x636E;&#x4E2D;&#x3002;</p>
<h2 id="2&#x8FDB;&#x4E00;&#x6B65;&#x63A2;&#x7D22;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;">2.&#x8FDB;&#x4E00;&#x6B65;&#x63A2;&#x7D22;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;</h2>
<p>&#x5728;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x7684;&#x6D4F;&#x89C8;&#x603B;&#x6570;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select sum(review_count) as totalreviews
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`;

+--------------+
| totalreviews |
+--------------+
| <span class="hljs-number">1236445</span>      |
+--------------+
</code></pre>
<p>&#x56FD;&#x5BB6;&#x548C;&#x57CE;&#x5E02;&#x603B;&#x6570;&#x7684;&#x8BC4;&#x8BBA;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select state, city, count(*) totalreviews
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`
group by state, city order by count(*) desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+------------+------------+--------------+
|   state    |    city    | totalreviews |
+------------+------------+--------------+
| NV         | Las Vegas  | <span class="hljs-number">12021</span>        |
| AZ         | Phoenix    | <span class="hljs-number">7499</span>         |
| AZ         | Scottsdale | <span class="hljs-number">3605</span>         |
| EDH        | Edinburgh  | <span class="hljs-number">2804</span>         |
| AZ         | Mesa       | <span class="hljs-number">2041</span>         |
| AZ         | Tempe      | <span class="hljs-number">2025</span>         |
| NV         | Henderson  | <span class="hljs-number">1914</span>         |
| AZ         | Chandler   | <span class="hljs-number">1637</span>         |
| WI         | Madison    | <span class="hljs-number">1630</span>         |
| AZ         | Glendale   | <span class="hljs-number">1196</span>         |
+------------+------------+--------------+
</code></pre>
<p>&#x6BCF;&#x4E00;&#x4E2A;&#x4F01;&#x4E1A;&#x661F;&#x7EA7;&#x8BC4;&#x5B9A;&#x7684;&#x5E73;&#x5747;&#x6B21;&#x6570;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select stars,trunc(avg(review_count)) reviewsavg
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`
group by stars order by stars desc;

+------------+------------+
|   stars    | reviewsavg |
+------------+------------+
| <span class="hljs-number">5.0</span>        | <span class="hljs-number">8.0</span>        |
| <span class="hljs-number">4.5</span>        | <span class="hljs-number">28.0</span>       |
| <span class="hljs-number">4.0</span>        | <span class="hljs-number">48.0</span>       |
| <span class="hljs-number">3.5</span>        | <span class="hljs-number">35.0</span>       |
| <span class="hljs-number">3.0</span>        | <span class="hljs-number">26.0</span>       |
| <span class="hljs-number">2.5</span>        | <span class="hljs-number">16.0</span>       |
| <span class="hljs-number">2.0</span>        | <span class="hljs-number">11.0</span>       |
| <span class="hljs-number">1.5</span>        | <span class="hljs-number">9.0</span>        |
| <span class="hljs-number">1.0</span>        | <span class="hljs-number">4.0</span>        |
+------------+------------+
</code></pre>
<p>&#x5177;&#x6709;&#x9AD8;&#x8BC4;&#x8BBA;&#x6570;&#x7684;&#x9876;&#x7EA7;&#x4F01;&#x4E1A;&#xFF08;1000&#xFF09;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select name, state, city, `review_count` from
dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`
<span class="hljs-built_in">where</span> review_count &gt; <span class="hljs-number">1000</span> order by `review_count` desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+-------------------------------+-------------+------------+---------------+
|           name                |   state     |    city    |  review_count |
+-------------------------------+-------------+------------+---------------+
| Mon Ami Gabi                  | NV          | Las Vegas  | <span class="hljs-number">4084</span>          |
| Earl of Sandwich              | NV          | Las Vegas  | <span class="hljs-number">3655</span>          |
| Wicked Spoon                  | NV          | Las Vegas  | <span class="hljs-number">3408</span>          |
| The Buffet                    | NV          | Las Vegas  | <span class="hljs-number">2791</span>          |
| Serendipity <span class="hljs-number">3</span>                 | NV          | Las Vegas  | <span class="hljs-number">2682</span>          |
| Bouchon                       | NV          | Las Vegas  | <span class="hljs-number">2419</span>          |
| The Buffet at Bellagio        | NV          | Las Vegas  | <span class="hljs-number">2404</span>          |
| Bacchanal Buffet              | NV          | Las Vegas  | <span class="hljs-number">2369</span>          |
| The Cosmopolitan of Las Vegas | NV          | Las Vegas  | <span class="hljs-number">2253</span>          |
| Aria Hotel &amp; Casino           | NV          | Las Vegas  | <span class="hljs-number">2224</span>          |
+-------------------------------+-------------+----------------------------+
</code></pre>
<p>&#x661F;&#x671F;&#x516D;&#x5F00;&#x653E;&#x548C;&#x5173;&#x95ED;&#x65F6;&#x95F4;&#x4E3A;&#x6570;&#x4E0D;&#x591A;&#x7684;&#x4F01;&#x4E1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select b.name, b.hours.Saturday.`open`,
b.hours.Saturday.`close`  
from
dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`
b <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+----------------------------+------------+------------+
|    name                    |   EXPR<span class="hljs-variable">$1</span>   |   EXPR<span class="hljs-variable">$2</span>   |
+----------------------------+------------+------------+
| Eric Goldberg, MD          | <span class="hljs-number">08</span>:<span class="hljs-number">00</span>      | <span class="hljs-number">17</span>:<span class="hljs-number">00</span>      |
| Pine Cone Restaurant       | null       | null       |
| Deforest Family Restaurant | <span class="hljs-number">06</span>:<span class="hljs-number">00</span>      | <span class="hljs-number">22</span>:<span class="hljs-number">00</span>      |
| Culver<span class="hljs-string">&apos;s                   | 10:30      | 22:00      |
| Chang Jiang Chinese Kitchen| 11:00      | 22:00      |
| Charter Communications     | null       | null       |
| Air Quality Systems        | null       | null       |
| McFarland Public Library   | 09:00      | 20:00      |
| Green Lantern Restaurant   | 06:00      | 02:00      |
| Spartan Animal Hospital    | 07:30      | 18:00      |
+----------------------------+------------+------------+
</span></code></pre>
<p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;Drill &#x662F;&#x5982;&#x4F55;&#x8FDB;&#x884C;&#x591A;&#x5C42;&#x5D4C;&#x5957;&#x7684;&#x3002;</p>
<h2 id="3&#x4ECE;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x83B7;&#x53D6;&#x8BBE;&#x5907;">3.&#x4ECE;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x83B7;&#x53D6;&#x8BBE;&#x5907;</h2>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x5728; Yelp &#x7684;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x7684;&#x5217;&#x5C5E;&#x6027;&#x6BCF;&#x4E00;&#x884C;&#x90FD;&#x662F;&#x4E0D;&#x540C;&#x7684;&#xFF0C;&#x4EE3;&#x8868;&#x4F01;&#x4E1A;&#x53EF;&#x4EE5;&#x62E5;&#x6709;&#x5355;&#x72EC;&#x7684;&#x8BBE;&#x5907;&#x3002;Drill &#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x7684;&#xFF0C;&#x5BB9;&#x6613;&#x7684;&#x53BB;&#x8BBF;&#x95EE;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x96C6;&#x5E76;&#x6539;&#x53D8;&#x5B83;&#x4EEC;&#x7684; Schema&#x3002;</p>
<p>&#x9996;&#x5148;&#xFF0C;&#x6539;&#x53D8; Drill &#x7684;&#x5DE5;&#x4F5C;&#x5728;&#x6240;&#x6709;&#x7684; text &#x6A21;&#x5F0F;&#x4E2D;&#xFF08;&#x8FD9;&#x6837;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x4E00;&#x770B;&#x6240;&#x6709;&#x7684;&#x6570;&#x636E;&#xFF09;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; alter system <span class="hljs-built_in">set</span> `store.json.all_text_mode` = <span class="hljs-literal">true</span>;
+------------+-----------------------------------+
|     ok     |  summary                          |
+------------+-----------------------------------+
| <span class="hljs-literal">true</span>       | store.json.all_text_mode updated. |
+------------+-----------------------------------+
</code></pre>
<p>&#x7136;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x53BB;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x7684;&#x5C5E;&#x6027;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select attributes from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                     attributes                                                                                                                    |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {<span class="hljs-string">&quot;By Appointment Only&quot;</span>:<span class="hljs-string">&quot;true&quot;</span>,<span class="hljs-string">&quot;Good For&quot;</span>:{},<span class="hljs-string">&quot;Ambience&quot;</span>:{},<span class="hljs-string">&quot;Parking&quot;</span>:{},<span class="hljs-string">&quot;Music&quot;</span>:{},<span class="hljs-string">&quot;Hair Types Specialized In&quot;</span>:{},<span class="hljs-string">&quot;Payment Types&quot;</span>:{},<span class="hljs-string">&quot;Dietary Restrictions&quot;</span>:{}}                    |
| {<span class="hljs-string">&quot;Take-out&quot;</span>:<span class="hljs-string">&quot;true&quot;</span>,<span class="hljs-string">&quot;Good For&quot;</span>:{<span class="hljs-string">&quot;dessert&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;latenight&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;lunch&quot;</span>:<span class="hljs-string">&quot;true&quot;</span>,<span class="hljs-string">&quot;dinner&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;breakfast&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;brunch&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>},<span class="hljs-string">&quot;Caters&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;Noise Level&quot;</span>:<span class="hljs-string">&quot;averag |
| {&quot;</span>Take-out<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;,&quot;</span>Good For<span class="hljs-string">&quot;:{&quot;</span>dessert<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>latenight<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>lunch<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>dinner<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>breakfast<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>brunch<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;},&quot;</span>Caters<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>Noise Level<span class="hljs-string">&quot;:&quot;</span>quiet<span class="hljs-string">&quot; |
| {&quot;</span>Take-out<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;,&quot;</span>Good For<span class="hljs-string">&quot;:{},&quot;</span>Takes Reservations<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>Delivery<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>Ambience<span class="hljs-string">&quot;:{},&quot;</span>Parking<span class="hljs-string">&quot;:{&quot;</span>garage<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>street<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>validated<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>lot<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;,&quot;</span>val |
| {<span class="hljs-string">&quot;Take-out&quot;</span>:<span class="hljs-string">&quot;true&quot;</span>,<span class="hljs-string">&quot;Good For&quot;</span>:{},<span class="hljs-string">&quot;Ambience&quot;</span>:{},<span class="hljs-string">&quot;Parking&quot;</span>:{},<span class="hljs-string">&quot;Has TV&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;Outdoor Seating&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>,<span class="hljs-string">&quot;Attire&quot;</span>:<span class="hljs-string">&quot;casual&quot;</span>,<span class="hljs-string">&quot;Music&quot;</span>:{},<span class="hljs-string">&quot;Hair Types Specialized In&quot;</span>:{},<span class="hljs-string">&quot;Payment Types |
| {&quot;</span>Good For<span class="hljs-string">&quot;:{},&quot;</span>Ambience<span class="hljs-string">&quot;:{},&quot;</span>Parking<span class="hljs-string">&quot;:{},&quot;</span>Music<span class="hljs-string">&quot;:{},&quot;</span>Hair Types Specialized In<span class="hljs-string">&quot;:{},&quot;</span>Payment Types<span class="hljs-string">&quot;:{},&quot;</span>Dietary Restrictions<span class="hljs-string">&quot;:{}}                                                 |
| {&quot;</span>Good For<span class="hljs-string">&quot;:{},&quot;</span>Ambience<span class="hljs-string">&quot;:{},&quot;</span>Parking<span class="hljs-string">&quot;:{},&quot;</span>Music<span class="hljs-string">&quot;:{},&quot;</span>Hair Types Specialized In<span class="hljs-string">&quot;:{},&quot;</span>Payment Types<span class="hljs-string">&quot;:{},&quot;</span>Dietary Restrictions<span class="hljs-string">&quot;:{}}                                                 |
| {&quot;</span>Good For<span class="hljs-string">&quot;:{},&quot;</span>Ambience<span class="hljs-string">&quot;:{},&quot;</span>Parking<span class="hljs-string">&quot;:{},&quot;</span>Wi-Fi<span class="hljs-string">&quot;:&quot;</span>free<span class="hljs-string">&quot;,&quot;</span>Music<span class="hljs-string">&quot;:{},&quot;</span>Hair Types Specialized In<span class="hljs-string">&quot;:{},&quot;</span>Payment Types<span class="hljs-string">&quot;:{},&quot;</span>Dietary Restrictions<span class="hljs-string">&quot;:{}}                                  |
| {&quot;</span>Take-out<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;,&quot;</span>Good For<span class="hljs-string">&quot;:{&quot;</span>dessert<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>latenight<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>lunch<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>dinner<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">true</span><span class="hljs-string">&quot;,&quot;</span>breakfast<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;,&quot;</span>brunch<span class="hljs-string">&quot;:&quot;</span><span class="hljs-literal">false</span><span class="hljs-string">&quot;},&quot;</span>Noise Level<span class="hljs-string">&quot;:&quot;</span>average<span class="hljs-string">&quot;                |
| {&quot;</span>Good For<span class="hljs-string">&quot;:{},&quot;</span>Ambience<span class="hljs-string">&quot;:{},&quot;</span>Parking<span class="hljs-string">&quot;:{},&quot;</span>Music<span class="hljs-string">&quot;:{},&quot;</span>Hair Types Specialized In<span class="hljs-string">&quot;:{},&quot;</span>Payment Types<span class="hljs-string">&quot;:{},&quot;</span>Dietary Restrictions<span class="hljs-string">&quot;:{}}                                                 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
</span></code></pre>
<pre><code>&#x6CE8;&#x91CA;&#xFF1A;

&#x672C;&#x6587;&#x4EF6;&#x4EE5;&#x793A;&#x4F8B;&#x4E3A;&#x76EE;&#x7684;&#x5BF9; Drill &#x7ED3;&#x679C;&#x8FDB;&#x884C;&#x8F93;&#x51FA;&#x3002;&#x8FD9;&#x79CD;&#x8F93;&#x51FA;&#x662F;&#x4E0D;&#x5BF9;&#x79F0;&#x7684;&#xFF08;&#x5373;&#xFF1A;&#x4E0D;&#x80FD;&#x5B8C;&#x5168;&#x5339;&#x914D;&#xFF09;&#x3002;
</code></pre><p>&#x5173;&#x95ED;&#x6240;&#x6709;&#x7684;&#x6587;&#x672C;&#x6A21;&#x5F0F;&#xFF0C;&#x8FD9;&#x6837;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x7EE7;&#x7EED;&#x6267;&#x884C;&#x6570;&#x636E;&#x7684;&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; alter system <span class="hljs-built_in">set</span> `store.json.all_text_mode` = <span class="hljs-literal">false</span>;
+-------+------------------------------------+
|  ok   |              summary               |
+-------+------------------------------------+
| <span class="hljs-literal">true</span>  | store.json.all_text_mode updated.  |
+-------+------------------------------------+
</code></pre>
<h2 id="4&#x5728;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x63A2;&#x7D22;&#x9910;&#x5385;">4.&#x5728;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x63A2;&#x7D22;&#x9910;&#x5385;</h2>
<p>&#x6570;&#x636E;&#x96C6;&#x4E2D;&#x7684;&#x9910;&#x5385;&#x6570;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select count(*) as TotalRestaurants from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` <span class="hljs-built_in">where</span> <span class="hljs-literal">true</span>=repeated_contains(categories,<span class="hljs-string">&apos;Restaurants&apos;</span>);
+------------------+
| TotalRestaurants |
+------------------+
| <span class="hljs-number">14303</span>            |
+------------------+
</code></pre>
<p>&#x9876;&#x7EA7;&#x9910;&#x5385;&#x7684;&#x8BC4;&#x8BBA;&#x6570;&#x91CF;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select name,state,city,`review_count` from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` <span class="hljs-built_in">where</span> <span class="hljs-literal">true</span>=repeated_contains(categories,<span class="hljs-string">&apos;Restaurants&apos;</span>) order by `review_count` desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+------------------------+-------+-----------+--------------+
|          name          | state |    city   | review_count |
+------------------------+-------+-----------+--------------+
| Mon Ami Gabi           | NV    | Las Vegas | <span class="hljs-number">4084</span>         |
| Earl of Sandwich       | NV    | Las Vegas | <span class="hljs-number">3655</span>         |
| Wicked Spoon           | NV    | Las Vegas | <span class="hljs-number">3408</span>         |
| The Buffet             | NV    | Las Vegas | <span class="hljs-number">2791</span>         |
| Serendipity <span class="hljs-number">3</span>          | NV    | Las Vegas | <span class="hljs-number">2682</span>         |
| Bouchon                | NV    | Las Vegas | <span class="hljs-number">2419</span>         |
| The Buffet at Bellagio | NV    | Las Vegas | <span class="hljs-number">2404</span>         |
| Bacchanal Buffet       | NV    | Las Vegas | <span class="hljs-number">2369</span>         |
| Hash House A Go Go     | NV    | Las Vegas | <span class="hljs-number">2201</span>         |
| Mesa Grill             | NV    | Las Vegas | <span class="hljs-number">2004</span>         |
+------------------------+-------+-----------+--------------+
</code></pre>
<p>&#x9876;&#x7EA7;&#x9910;&#x5385;&#x7684;&#x79CD;&#x7C7B;&#x6E05;&#x6DE1;&#x5217;&#x8868;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select name,repeated_count(categories) as categorycount, categories from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` <span class="hljs-built_in">where</span> <span class="hljs-literal">true</span>=repeated_contains(categories,<span class="hljs-string">&apos;Restaurants&apos;</span>) order by repeated_count(categories) desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+---------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| name                            | categorycount | categories                                                                                                                                        |
+---------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| Binion<span class="hljs-string">&apos;s Hotel &amp; Casino         | 10            | [&quot;Arts &amp;,Entertainment&quot;,&quot;Restaurants&quot;,&quot;Bars&quot;,&quot;Casinos&quot;,&quot;Event,Planning &amp;,Services&quot;,&quot;Lounges&quot;,&quot;Nightlife&quot;,&quot;Hotels &amp;,Travel&quot;,&quot;American]             |
| Stage Deli                      | 10            | [&quot;Arts &amp;,Entertainment&quot;,&quot;Food&quot;,&quot;Hotels&quot;,&quot;Desserts&quot;,&quot;Delis&quot;,&quot;Casinos&quot;,&quot;Sandwiches&quot;,&quot;Hotels,&amp; Travel&quot;,&quot;Restaurants&quot;,&quot;Event Planning &amp;,Services&quot;]    |
| Jillian&apos;</span>s                       | <span class="hljs-number">9</span>             | [<span class="hljs-string">&quot;Arts &amp;,Entertainment&quot;</span>,<span class="hljs-string">&quot;American (Traditional)&quot;</span>,<span class="hljs-string">&quot;Music,Venues&quot;</span>,<span class="hljs-string">&quot;Bars&quot;</span>,<span class="hljs-string">&quot;Dance,Clubs&quot;</span>,<span class="hljs-string">&quot;Nightlife&quot;</span>,<span class="hljs-string">&quot;Bowling&quot;</span>,<span class="hljs-string">&quot;Active,Life&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>]           |
| Hotel Chocolat                  | <span class="hljs-number">9</span>             | [<span class="hljs-string">&quot;Coffee &amp;,Tea&quot;</span>,<span class="hljs-string">&quot;Food&quot;</span>,<span class="hljs-string">&quot;Cafes&quot;</span>,<span class="hljs-string">&quot;Chocolatiers &amp;,Shops&quot;</span>,<span class="hljs-string">&quot;Specialty Food&quot;</span>,<span class="hljs-string">&quot;Event Planning &amp;,Services&quot;</span>,<span class="hljs-string">&quot;Hotels &amp; Travel&quot;</span>,<span class="hljs-string">&quot;Hotels&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>]      |
| Hotel du V<span class="hljs-keyword">in</span> &amp; Bistro Edinburgh | <span class="hljs-number">9</span>             | [<span class="hljs-string">&quot;Modern,European&quot;</span>,<span class="hljs-string">&quot;Bars&quot;</span>,<span class="hljs-string">&quot;French&quot;</span>,<span class="hljs-string">&quot;Wine,Bars&quot;</span>,<span class="hljs-string">&quot;Event Planning &amp;,Services&quot;</span>,<span class="hljs-string">&quot;Nightlife&quot;</span>,<span class="hljs-string">&quot;Hotels &amp;,Travel&quot;</span>,<span class="hljs-string">&quot;Hotels&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>]                  |
| Elixir                          | <span class="hljs-number">9</span>             | [<span class="hljs-string">&quot;Arts &amp;,Entertainment&quot;</span>,<span class="hljs-string">&quot;American (Traditional)&quot;</span>,<span class="hljs-string">&quot;Music,Venues&quot;</span>,<span class="hljs-string">&quot;Bars&quot;</span>,<span class="hljs-string">&quot;Cocktail,Bars&quot;</span>,<span class="hljs-string">&quot;Nightlife&quot;</span>,<span class="hljs-string">&quot;American (New)&quot;</span>,<span class="hljs-string">&quot;Local,Flavor&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>] |
| Tocasierra Spa and Fitness      | <span class="hljs-number">8</span>             | [<span class="hljs-string">&quot;Beauty &amp;,Spas&quot;</span>,<span class="hljs-string">&quot;Gyms&quot;</span>,<span class="hljs-string">&quot;Medical Spas&quot;</span>,<span class="hljs-string">&quot;Health &amp;,Medical&quot;</span>,<span class="hljs-string">&quot;Fitness &amp; Instruction&quot;</span>,<span class="hljs-string">&quot;Active,Life&quot;</span>,<span class="hljs-string">&quot;Day Spas&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>]                         |
| Costa Del Sol At S<span class="hljs-built_in">unset</span> Station | <span class="hljs-number">8</span>             | [<span class="hljs-string">&quot;Steakhouses&quot;</span>,<span class="hljs-string">&quot;Mexican&quot;</span>,<span class="hljs-string">&quot;Seafood&quot;</span>,<span class="hljs-string">&quot;Event,Planning &amp; Services&quot;</span>,<span class="hljs-string">&quot;Hotels &amp;,Travel&quot;</span>,<span class="hljs-string">&quot;Italian&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>,<span class="hljs-string">&quot;Hotels&quot;</span>]                                |
| Scottsdale Silverado Golf Club  | <span class="hljs-number">8</span>             | [<span class="hljs-string">&quot;Fashion&quot;</span>,<span class="hljs-string">&quot;Shopping&quot;</span>,<span class="hljs-string">&quot;Sporting,Goods&quot;</span>,<span class="hljs-string">&quot;Active Life&quot;</span>,<span class="hljs-string">&quot;Golf&quot;</span>,<span class="hljs-string">&quot;American,(New)&quot;</span>,<span class="hljs-string">&quot;Sports Wear&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>]                                         |
| House of Blues                  | <span class="hljs-number">8</span>             | [<span class="hljs-string">&quot;Arts &amp; Entertainment&quot;</span>,<span class="hljs-string">&quot;Music Venues&quot;</span>,<span class="hljs-string">&quot;Restaurants&quot;</span>,<span class="hljs-string">&quot;Hotels&quot;</span>,<span class="hljs-string">&quot;Event Planning &amp; Services&quot;</span>,<span class="hljs-string">&quot;Hotels &amp; Travel&quot;</span>,<span class="hljs-string">&quot;American (New)&quot;</span>,<span class="hljs-string">&quot;Nightlife&quot;</span>]         |
+---------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
</code></pre>
<pre><code class="lang-bash">&#x6CE8;&#x91CA;&#xFF1A;

&#x672C;&#x6587;&#x4EF6;&#x4EE5;&#x793A;&#x4F8B;&#x4E3A;&#x76EE;&#x7684;&#x5BF9; Drill &#x7ED3;&#x679C;&#x8FDB;&#x884C;&#x8F93;&#x51FA;&#x3002;&#x8FD9;&#x79CD;&#x8F93;&#x51FA;&#x662F;&#x4E0D;&#x5BF9;&#x79F0;&#x7684;&#xFF08;&#x5373;&#xFF1A;&#x4E0D;&#x80FD;&#x5B8C;&#x5168;&#x5339;&#x914D;&#xFF09;&#x3002;
</code></pre>
<p>&#x8BC4;&#x8BBA;&#x6570;&#x7B2C;&#x4E00;&#x54C1;&#x79CD;&#x7EDF;&#x8BA1;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select categories[<span class="hljs-number">0</span>], count(categories[<span class="hljs-number">0</span>]) as categorycount
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp_academic_dataset_business.json`
group by categories[<span class="hljs-number">0</span>]
order by count(categories[<span class="hljs-number">0</span>]) desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span>;

+----------------------+---------------+
| EXPR<span class="hljs-variable">$0</span>               | categorycount |
+----------------------+---------------+
| Food                 | <span class="hljs-number">4294</span>          |
| Shopping             | <span class="hljs-number">1885</span>          |
| Active Life          | <span class="hljs-number">1676</span>          |
| Bars                 | <span class="hljs-number">1366</span>          |
| Local Services       | <span class="hljs-number">1351</span>          |
| Mexican              | <span class="hljs-number">1284</span>          |
| Hotels &amp; Travel      | <span class="hljs-number">1283</span>          |
| Fast Food            | <span class="hljs-number">963</span>           |
| Arts &amp; Entertainment | <span class="hljs-number">906</span>           |
| Hair Salons          | <span class="hljs-number">901</span>           |
+----------------------+---------------+
</code></pre>
<h2 id="5&#x63A2;&#x7D22;-yelp-&#x7684;&#x8BC4;&#x8BBA;&#x4E8E;&#x6570;&#x636E;&#x96C6;&#x5E76;&#x7ED3;&#x5408;&#x4E1A;&#x52A1;&#x6570;&#x636E;">5.&#x63A2;&#x7D22; Yelp &#x7684;&#x8BC4;&#x8BBA;&#x4E8E;&#x6570;&#x636E;&#x96C6;&#x5E76;&#x7ED3;&#x5408;&#x4E1A;&#x52A1;&#x6570;&#x636E;</h2>
<p>&#x63A5;&#x4E0B;&#x6765;&#xFF0C;&#x8BA9;&#x6211;&#x4EEC;&#x6765;&#x4E00;&#x8D77;&#x770B;&#x770B; Yelp &#x8BC4;&#x8BBA;&#x6570;&#x636E;&#x96C6;&#x7684;&#x5185;&#x5BB9;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select *
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_review.json` <span class="hljs-built_in">limit</span> <span class="hljs-number">1</span>;
+---------------------------------+------------------------+------------------------+-------+------------+----------------------------------------------------------------------+--------+------------------------+
| votes                           | user_id                | review_id              | stars | date       | text                                                                 | <span class="hljs-built_in">type</span>   | business_id            |
+---------------------------------+------------------------+------------------------+-------+------------+----------------------------------------------------------------------+--------+------------------------+
| {<span class="hljs-string">&quot;funny&quot;</span>:<span class="hljs-number">0</span>,<span class="hljs-string">&quot;useful&quot;</span>:<span class="hljs-number">2</span>,<span class="hljs-string">&quot;cool&quot;</span>:<span class="hljs-number">1</span>} | Xqd0DzHaiyRqVH3WRG7hzg | <span class="hljs-number">15</span>SdjuK7DmYqUAj6rjGowg | <span class="hljs-number">5</span>     | <span class="hljs-number">2007</span>-<span class="hljs-number">05</span>-<span class="hljs-number">17</span> | dr. goldberg offers everything i look <span class="hljs-keyword">for</span> <span class="hljs-keyword">in</span> a general practitioner. | review | vcNAWiLM4dR7D2nwwJ7nCA |
+---------------------------------+------------------------+------------------------+-------+------------+----------------------------------------------------------------------+--------+------------------------+
</code></pre>
<p>&#x8BC4;&#x8BBA;&#x6700;&#x9177;&#x7684;&#x9876;&#x7EA7;&#x4F01;&#x4E1A;</p>
<p>&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x6211;&#x4EEC;&#x7ED3;&#x5408;Yelp&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x96C6;&#xFF0C;&#x5BF9; Yelp &#x7684;&#x8BC4;&#x8BBA;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x5168;&#x9762;&#x7684;&#x8BC4;&#x8BBA;&#x7EDF;&#x8BA1;&#xFF0C;&#x5B83;&#x6DB5;&#x76D6;&#x6BCF;&#x4E2A;&#x8BC4;&#x8BBA;&#x7684;&#x7EC6;&#x8282;&#x4FE1;&#x606F;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; Select b.name
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` b
<span class="hljs-built_in">where</span> b.business_id <span class="hljs-keyword">in</span> (SELECT r.business_id
FROM dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_review.json` r
GROUP BY r.business_id having sum(r.votes.cool) &gt; <span class="hljs-number">2000</span>
order by sum(r.votes.cool)  desc);
+-------------------------------+
|             name              |
+-------------------------------+
| Earl of Sandwich              |
| XS Nightclub                  |
| The Cosmopolitan of Las Vegas |
| Wicked Spoon                  |
+-------------------------------+
</code></pre>
<p>&#x7ED3;&#x5408;&#x4E1A;&#x52A1;&#x6570;&#x636E;&#x548C;&#x8BC4;&#x8BBA;&#x6570;&#x636E;&#x96C6;&#x53BB;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x89C6;&#x56FE;</p>
<p>&#x6CE8;&#x610F; Drill &#x7684;&#x89C6;&#x56FE;&#x662F;&#x4E00;&#x4E2A;&#x8F7B;&#x91CF;&#x7EA7;&#x7684;&#xFF0C;&#x5E76;&#x4E14;&#x53EF;&#x4EE5;&#x5728;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#x521B;&#x5EFA;&#x3002;&#x5728;&#x72EC;&#x7ACB;&#x6A21;&#x5F0F;&#x4E2D;&#x6709;&#x4E00;&#x4E2A; dfs.tmp &#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;&#x3002;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7528;&#x5B83;&#x6765;&#x521B;&#x5EFA;&#x89C6;&#x56FE;&#xFF08;&#x6216;&#x8005;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x5728;&#x672C;&#x5730;&#x6216;&#x5206;&#x5E03;&#x5F0F;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x7684;&#x5DE5;&#x4F5C;&#x7A7A;&#x7A7A;&#x95F4;&#xFF09;&#x3002;&#x5982;&#x679C;&#x4F60;&#x60F3;&#x7528;&#x7269;&#x7406;&#x7684;&#x65B9;&#x5F0F;&#x66FF;&#x4EE3;&#x903B;&#x8F91;&#x65B9;&#x5F0F;&#x7528;&#x4E8E;&#x6301;&#x4E45;&#x5316;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x521B;&#x5EFA;&#x8868;&#xFF08;<code>CREATE TABLE AS</code>&#xFF09;&#x7684;&#x8BED;&#x6CD5;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; create or replace view dfs.tmp.businessreviews as
Select b.name,b.stars,b.state,b.city,r.votes.funny,r.votes.useful,r.votes.cool, r.`date`
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json` b, dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_review.json` r
<span class="hljs-built_in">where</span> r.business_id=b.business_id
+------------+-----------------------------------------------------------------+
|     ok     |                           summary                               |
+------------+-----------------------------------------------------------------+
| <span class="hljs-literal">true</span>       | View <span class="hljs-string">&apos;businessreviews&apos;</span> created successfully <span class="hljs-keyword">in</span> <span class="hljs-string">&apos;dfs.tmp&apos;</span> schema |
+------------+-----------------------------------------------------------------+
</code></pre>
<p>&#x8BA9;&#x6211;&#x4EEC;&#x4ECE;&#x89C6;&#x56FE;&#x4E2D;&#x83B7;&#x5F97;&#x8BB0;&#x5F55;&#x7684;&#x603B;&#x6570;&#x3002;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select count(*) as Total from dfs.tmp.businessreviews;
+------------+
|   Total    |
+------------+
| <span class="hljs-number">1125458</span>    |
+------------+
</code></pre>
<p>&#x9664;&#x4E86;&#x8FD9;&#x4E9B;&#x95EE;&#x9898;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; Drill &#x7684; SQL &#x529F;&#x80FD;&#x5F97;&#x5230;&#x8BB8;&#x591A;&#x6DF1;&#x523B;&#x7684;&#x89C1;&#x89E3;&#x3002;&#x5982;&#x679C;&#x4F60;&#x4E0D;&#x4E50;&#x610F;&#x53BB;&#x624B;&#x52A8;&#x7F16;&#x5199;&#x67E5;&#x8BE2;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E00;&#x4E2A; BI &#x5206;&#x6790;&#x5DE5;&#x5177;&#xFF0C;&#x4F8B;&#x5982; Tableau/MicroStrategy &#x4F7F;&#x7528; ODBC/JDBC &#x9A71;&#x52A8; &#x53BB;&#x67E5;&#x8BE2;&#x539F;&#x59CB;&#x6587;&#x4EF6;&#xFF0C;Hive&#xFF0C;HBase &#x6570;&#x636E;&#x6216; Drill &#x521B;&#x5EFA;&#x7684;&#x89C6;&#x56FE;&#x3002;</p>
<p>Apache Drill &#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x81EA;&#x7531;&#x548C;&#x7075;&#x6D3B;&#x7684;&#x63A2;&#x7D22;&#x6570;&#x636E;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x662F;&#x4E4B;&#x524D;&#x6211;&#x4EEC;&#x4ECE;&#x672A;&#x89C1;&#x8FC7;&#x7684; SQL &#x6280;&#x672F;&#x3002;&#x793E;&#x533A;&#x6B63;&#x5728;&#x4F7F;&#x7528;&#x5D4C;&#x5957;&#x6570;&#x636E;&#x5E76;&#x4E14;&#x80FD;&#x591F;&#x5728;&#x5373;&#x5C06;&#x53D1;&#x5E03;&#x7684;&#x7248;&#x672C;&#x4E2D;&#x652F;&#x6301;&#x6539;&#x53D8; Schema&#x3002;</p>
<p>FLATTEN &#x51FD;&#x6570;&#x80FD;&#x591F;&#x7528;&#x4E8E;&#x52A8;&#x6001;&#x7684;&#xFF0C;&#x534A;&#x7ED3;&#x6784;&#x5316;&#x6570;&#x636E;&#xFF0C;&#x4EE5;&#x4FBF;&#x6211;&#x4EEC;&#x80FD;&#x591F;&#x4F7F;&#x7528;&#x66F4;&#x52A0;&#x6DF1;&#x5165;&#x7684; SQL &#x529F;&#x80FD;&#x3002;&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E2A;&#x793A;&#x4F8B;&#x67E5;&#x8BE2;&#xFF1A;</p>
<p>&#x4E3A;&#x6BCF;&#x4E2A;&#x4E1A;&#x52A1;&#x5F97;&#x5230;&#x4E00;&#x4E2A;&#x6241;&#x5E73;&#x7684;&#x7C7B;&#x522B;&#x5217;&#x8868;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select name, flatten(categories) as category
from dfs.`/&lt;path-to-yelp-dataset&gt;/yelp/yelp_academic_dataset_business.json`  <span class="hljs-built_in">limit</span> <span class="hljs-number">20</span>;
+-----------------------------+---------------------------------+
| name                        | category                        |
+-----------------------------+---------------------------------+
| Eric Goldberg, MD           | Doctors                         |
| Eric Goldberg, MD           | Health &amp; Medical                |
| Pine Cone Restaurant        | Restaurants                     |
| Deforest Family Restaurant  | American (Traditional)          |
| Deforest Family Restaurant  | Restaurants                     |
| Culver<span class="hljs-string">&apos;s                    | Food                            |
| Culver&apos;</span>s                    | Ice Cream &amp; Frozen Yogurt       |
| Culver<span class="hljs-string">&apos;s                    | Fast Food                       |
| Culver&apos;</span>s                    | Restaurants                     |
| Chang Jiang Chinese Kitchen | Chinese                         |
| Chang Jiang Chinese Kitchen | Restaurants                     |
| Charter Communications      | Television Stations             |
| Charter Communications      | Mass Media                      |
| Air Quality Systems         | Home Services                   |
| Air Quality Systems         | Heating &amp; Air Conditioning/HVAC |
| McFarland Public Library    | Libraries                       |
| McFarland Public Library    | Public Services &amp; Government    |
| Green Lantern Restaurant    | American (Traditional)          |
| Green Lantern Restaurant    | Restaurants                     |
| Spartan Animal Hospital     | Veterinarians                   |
+-----------------------------+---------------------------------+
</code></pre>
<p>&#x9876;&#x7EA7;&#x7684;&#x54C1;&#x79CD;&#x8BC4;&#x8BBA;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:zk=<span class="hljs-built_in">local</span>&gt; select celltbl.catl, count(celltbl.catl) categorycnt
from (select flatten(categories) catl from dfs.`/yelp_academic_dataset_business.json` ) celltbl
group by celltbl.catl
order by count(celltbl.catl) desc <span class="hljs-built_in">limit</span> <span class="hljs-number">10</span> ;
+------------------+-------------+
| catl             | categorycnt |
+------------------+-------------+
| Restaurants      | <span class="hljs-number">14303</span>       |
| Shopping         | <span class="hljs-number">6428</span>        |
| Food             | <span class="hljs-number">5209</span>        |
| Beauty &amp; Spas    | <span class="hljs-number">3421</span>        |
| Nightlife        | <span class="hljs-number">2870</span>        |
| Bars             | <span class="hljs-number">2378</span>        |
| Health &amp; Medical | <span class="hljs-number">2351</span>        |
| Automotive       | <span class="hljs-number">2241</span>        |
| Home Services    | <span class="hljs-number">1957</span>        |
| Fashion          | <span class="hljs-number">1897</span>        |
+------------------+-------------+
</code></pre>
<p>&#x656C;&#x8BF7;&#x671F;&#x5F85;&#x793E;&#x533A;&#x53D1;&#x5E03;&#x66F4;&#x591A;&#x7684;&#x7248;&#x672C;&#x548C;&#x6D3B;&#x52A8;&#x3002;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; http://drill.smartloli.org 2016 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">Modify: 
2016-01-07 15:29:36
</span></footer>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../3.教程/2.Drill in 10 Minutes 快速指导.html" class="navigation navigation-prev " aria-label="Previous page: 2.Drill in 10 Minutes 快速指导"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html" class="navigation navigation-next " aria-label="Next page: 1.关于 MapR 的 Sandbox"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-baidu/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"tbfed-pagefooter":{"copyright":"Copyright &copy http://drill.smartloli.org 2016","modify_label":"Modify: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"baidu":{"token":""},"fontsettings":{"size":1,"theme":"white","family":"sans"},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"livereload":{}};
    gitbook.start(config);
});
</script>

        <script>var _hmt = _hmt || [];(function() {var hm = document.createElement('script');hm.src = '//hm.baidu.com/hm.js?';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(hm, s);})();</script>
    </body>
    
</html>
